<!DOCTYPE html>
<html lang="zh-CN" style="--status-bar-height:0px; font-size: 18.75px; --window-top:44px; --window-bottom:0px;">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>
			超新润滑油-新用户注册
		</title>
		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover">
		<link rel="stylesheet" href="/assets/user/css/index.css">
		<link rel="stylesheet" type="text/css" href="/assets/user/css/public.css">

		<link rel="stylesheet" type="text/css" href="/assets/user/css/mobileSelect.css">
		<script src="/assets/user/js/mobileSelect.js" type="text/javascript"></script>
		<script src="/assets/user/js/jquery-1.4.4.min.js" type="text/javascript"></script>
		<script src="/assets/user/layer_mobile/layer.js" type="text/javascript"></script>
	</head>

	<body class="uni-body pages-submit_form-login">
		<uni-app class="">
			<uni-page data-page="pages/submit_form/login">
				<uni-page-head uni-page-head-type="default">
					<div class="uni-page-head" style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 0);">
						<div class="uni-page-head-hd">
							<div class="uni-page-head-btn" style="display: none;"><i class="uni-btn-icon" style="color: rgb(0, 0, 0); font-size: 27px;"></i></div>
						</div>
						<div class="uni-page-head-bd">
							<div class="uni-page-head__title" style="font-size: 16px; opacity: 1;">
								<!---->
								用户注册
							</div>
						</div>
						<!---->
						<div class="uni-page-head-ft"></div>
					</div>
					<div class="uni-placeholder"></div>
				</uni-page-head>
				<!---->
				<uni-page-wrapper>
					<uni-page-body>
						<div data-v-cfaa2848="" class="content">
							<div data-v-cfaa2848="" class="register_box">
								<div data-v-cfaa2848="" class="form_cont">
									<div data-v-cfaa2848="" class="item">
										<div data-v-cfaa2848="" class="c-item">
											<uni-input data-v-cfaa2848="" style="position: relative;">
												<div><input maxlength="140" step="" id="mobile" type="text" style="height: 26.25px; line-height: 26.25px;" placeholder="请输入手机号码">
												</div>
											</uni-input>
											<!---->
										</div>
									</div>
									<div data-v-cfaa2848="" class="item">
										<div data-v-cfaa2848="" class="c-item" style="margin-right: 15px; flex: 1.8 1 0%;">
											<uni-input data-v-cfaa2848="" style="position: relative;">
												<div><input maxlength="140" step="" id="code" type="text" style="height: 26.25px; line-height: 26.25px;" placeholder="请输入短信验证码">
												</div>
											</uni-input>
										</div>
										<div data-v-cfaa2848="" class="c-item getCode">
											<uni-input data-v-cfaa2848="" style="flex: 1 1 0%; position: relative;">
												<div disabled="disabled">
													<div class="input-placeholder" id="mobile_code_send" style="height: 26.25px; line-height: 26.25px;color:#00a4f4">获取验证码</div>
												</div>
											</uni-input>
										</div>
									</div>
									<div data-v-cfaa2848="" class="item">
										<div data-v-cfaa2848="" class="c-item">
											<uni-input data-v-cfaa2848="" style="position: relative;">
												<div><input maxlength="140" step="" id="pass" type="password" placeholder="请输入密码">
												</div>
												<uni-resize-sensor>
													<div>
														<div></div>
													</div>
													<div>
														<div></div>
													</div>
												</uni-resize-sensor>
											</uni-input>
											<!---->
											<!---->
										</div>
									</div>
									<div data-v-cfaa2848="" class="item">
										<div data-v-cfaa2848="" class="c-item">
											<uni-input data-v-cfaa2848="" style="position: relative;">
												<div><input maxlength="140" step="" value="" id="nickname" type="text" style="height: 26.25px; line-height: 26.25px;" placeholder="请输入您的姓名">
												</div>
											</uni-input>
											<!---->
										</div>
									</div>
									<div data-v-cfaa2848="" class="item">
										<div data-v-cfaa2848="" class="c-item">
											<uni-input data-v-cfaa2848="" style="position: relative;">
												<div><input maxlength="140" step="" readonly id="trigger4" type="text" placeholder="请选择地区">
												</div>
												<uni-resize-sensor>
													<div>
														<div></div>
													</div>
													<div>
														<div></div>
													</div>
												</uni-resize-sensor>
											</uni-input>
											<!---->
											<!---->
										</div>
									</div>
									<div data-v-cfaa2848="" class="item">
										<div data-v-cfaa2848="" class="c-item" style="background:#efefef;">
											<uni-input data-v-cfaa2848="" style="position: relative;">
												<div><input maxlength="140" step="" value="<?php echo $share_code;?>" id="share_code" type="text" style="height: 26.25px; line-height: 26.25px;" readonly placeholder="">
												</div>
											</uni-input>
											<!---->
										</div>
									</div>
									<div data-v-cfaa2848="" class="item reg_btn_box">
										<uni-label data-v-cfaa2848="">
											<uni-checkbox data-v-cfaa2848="">
												<div class="uni-checkbox-wrapper">
													<div class="uni-checkbox-input uni-checkbox-input-checked" style="color: rgb(0, 122, 255);"></div>
												</div>
											</uni-checkbox>我已阅读 用户注册服务协议
										</uni-label>
										<input id="area_data" type="hidden" />
										<uni-button data-v-cfaa2848="" class="f_btn">确认注册</uni-button>
									</div>
									<div data-v-cfaa2848="" class="item f_links">
										<uni-navigator data-v-cfaa2848="" class="links">仅用于接收验证码，加密传输不会泄露您的个人信息</uni-navigator>
									</div>
								</div>
							</div>
						</div>
					</uni-page-body>
				</uni-page-wrapper>
			</uni-page>
	</body>
	<script>
		var mobileSelect4 = new MobileSelect({
			trigger: '#trigger4',
			title: '地区选择',
			wheels: [<?php echo json_encode($data)?>],
			callback:function(indexArr, data){
				var result = new Array();
				var name_data = new Array();
				$.each(data , function( k,v ){
					result.push(v.id);
					name_data.push(v.value);
				});
				$("#area_data").val(result.join('-'));
				$("#trigger4").val(name_data.join('-'));
			}  
		});
		$("#mobile_code_send").click(function(){
			var mobile = $("#mobile").val();
			if( mobile == '' ) {
				layer.open({content: '请输入您要注册的手机号',skin: 'msg',time:2});
				return false;
			}
			var index = layer.open({type: 2});
			$.get("<?php echo url("api/index/sendSms")?>" , { mobile : mobile , type : 1 } , function(data){
				layer.close(index);
				layer.open({
					content: data.msg,
					btn: '确定'
				});
			},'json');
		});
		$(".f_btn").click(function(){
			var mobile = $("#mobile").val();
			if( mobile == '' ) {
				layer.open({content: '请输入您要注册的手机号',skin: 'msg',time:2});
				return false;
			}
			var code = $("#code").val();
			if( code == '' ) {
				layer.open({content: '请输入短信验证码',skin: 'msg',time:2});
				return false;
			}
			var pass = $("#pass").val();
			if( pass == '' ) {
				layer.open({content: '请输入密码',skin: 'msg',time:2});
				return false;
			}
			var nickname = $("#nickname").val();
			if( nickname == '' ) {
				layer.open({content: '请输入您的姓名',skin: 'msg',time:2});
				return false;
			}
			var area_data = $("#area_data").val();
			if( area_data == '' ) {
				layer.open({content: '请选择地区',skin: 'msg',time:2});
				return false;
			}
			area_data = area_data.split("-");
			var index = layer.open({type: 2,content:'正在注册...'});
			$.post("<?php echo url("api/index/register")?>" , { share_code : $("#share_code").val() , nickname : nickname , mobile : mobile , code : code , password : pass , province : area_data[0] , city : area_data[1] , area : area_data[2] } , function(data){
				layer.close(index);
				layer.open({
					content: data.msg,
					btn: '确定',
					yes: function(index){
						location.href="/index.php?s=/index/index/version";
					}
				});
			},'json');
		});
	</script>
</html>
